package basic.test;

import java.math.BigInteger;
import java.util.Scanner;

/**
 * @author code_yc
 * @version 1.0
 * @date 2020/7/31 10:09
 */
public class XM37 {


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        System.out.println(cal(n));
    }

    private static String cal(int n) {
        if (n <= 2) return "1";
        BigInteger[] dp = new BigInteger[n + 1];
        dp[0] = dp[1] = dp[2] = new BigInteger("1");
        for (int i = 3; i <= n; i++) {
            dp[i] = dp[i - 3].add(dp[i - 1]);
        }
        return dp[n].toString();
    }
}
